<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/react.development.js"></script>
  <script src="./js/react-dom.development.js"></script>
  <script src="./js/babel.min.js"></script>
  <style>
    .title {
      color: rgb(187, 123, 123);
    }
  </style>
</head>
<body>
  <div id="app"></div>



  <script type="text/babel">


    const vDom = (
      <div>
        {
        /* 
        - 必须是对象
        - 样式属性名使用小驼峰命名法
        - 如果样式是数值，可以省略单位
        */
        }
        <h2 style={{color: 'red', fontSize: 30}}>React style</h2>
        {
        /* 
        必须用className, 不能用class
        */
        }
        <h2 className="title">React class</h2>
      </div>
    )
    // 渲染虚拟DOM
    ReactDOM.render(vDom, document.getElementById('app'))
  </script>
</body>
</html>